<template>
  <tr>
    <td><input type="text" @input="add" :value="value" /></td>
    <td>{{ goodsName }}</td>
    <td v-if="num <= 0">卖光了!!!</td>
  </tr>
</template>

<script>
export default {
  //   name: "",
  components: {},
  props: {
    value: {
      type: Number,
      require: true,
    },
    goodsName: {
      type: String,
      require: true,
    },
  },
  data() {
    return {
      num: 0,
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    add(e) {
      this.num = +e.target.value;
      this.$emit("input", e.target.value);
    },
  },
};
</script>

<style lang="less" scoped></style>
